package xju.springboot_maven11_12.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import xju.springboot_maven11_12.entiy.User;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select  * from newtable where deleted = 0")
    List<User> selectAll();

    User selectById(int id);

    User selectBySnAndPassword(@Param("sn") String sn, @Param("password") String password);

    @Select("select  * from newtable")
    List<User> pageList(IPage<User> page);

    @Select("select  * from newtable")
    IPage<User> pageList1(IPage<User> page);

//    @Insert("insert into newtable(sn,name,password) values (#{user.sn},#{user.name},#{user.password})")
//    int insert(@Param("user") User user);
}
